﻿// <copyright file="Tick.cs" company="Golizza.net">Copyright (c) 2012 All Right Reserved</copyright>

namespace Sharemarker.BinaryOptionApplication.Models
{
    using System;

    using Sharemarker.Common.Framework;

    /// <summary>
    /// Model for the candle chart segment.
    /// </summary>
    public class Tick : NotifyPropertyChangedBase
    {
        #region Fields

        /// <summary>
        /// The back up value for <see cref="Close"/> property.
        /// </summary>
        private double close;

        /// <summary>
        /// The back up value for <see cref="High"/> property.
        /// </summary>
        private double high;

        /// <summary>
        /// The back up value for <see cref="Low"/> property.
        /// </summary>
        private double low;

        /// <summary>
        /// The back up value for <see cref="Open"/> property.
        /// </summary>
        private double open;

        /// <summary>
        /// The back up value for <see cref="TimeStamp"/> property.
        /// </summary>
        private DateTime timeStamp;

        #endregion

        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="Tick" /> class.
        /// </summary>
        /// <param name="open">The open.</param>
        /// <param name="close">The close.</param>
        /// <param name="high">The high.</param>
        /// <param name="low">The low.</param>
        /// <param name="timeStamp">The time stamp.</param>
        public Tick(double open, double close, double high, double low, DateTime timeStamp)
        {
            this.open = open;
            this.close = close;
            this.high = high;
            this.low = low;
            this.timeStamp = timeStamp;
        }

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets or sets the Close.
        /// </summary>
        public double Close
        {
            get
            {
                return this.close;
            }

            set
            {
                if (this.close != value)
                {
                    this.close = value;
                    this.OnPropertyChanged("Close");
                }
            }
        }

        /// <summary>
        /// Gets or sets the High.
        /// </summary>
        public double High
        {
            get
            {
                return this.high;
            }

            set
            {
                if (this.high != value)
                {
                    this.high = value;
                    this.OnPropertyChanged("High");
                }
            }
        }

        /// <summary>
        /// Gets or sets the Low.
        /// </summary>
        public double Low
        {
            get
            {
                return this.low;
            }

            set
            {
                if (this.low != value)
                {
                    this.low = value;
                    this.OnPropertyChanged("Low");
                }
            }
        }

        /// <summary>
        /// Gets or sets the Open.
        /// </summary>
        public double Open
        {
            get
            {
                return this.open;
            }

            set
            {
                if (this.open != value)
                {
                    this.open = value;
                    this.OnPropertyChanged("Open");
                }
            }
        }

        /// <summary>
        /// Gets or sets the TimeStamp.
        /// </summary>
        public DateTime TimeStamp
        {
            get
            {
                return this.timeStamp;
            }

            set
            {
                if (this.timeStamp != value)
                {
                    this.timeStamp = value;
                    this.OnPropertyChanged("TimeStamp");
                }
            }
        }

        #endregion
    }
}